package com.web.kdl.util;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zhangQi
 * @date 2022/5/20 - 10:23
 */
public class DateUtil {

    //20220111142750
    public Map timeGetUtil(String operationTime) {
        Map<String,Object> map = new HashMap<>();
        int year = Integer.parseInt(operationTime.substring(0,4));
        int month = Integer.parseInt(operationTime.substring(4,6));
        int day = Integer.parseInt(operationTime.substring(6,8));
        int hour = Integer.parseInt(operationTime.substring(8,10));
        StringBuilder time = new StringBuilder(operationTime);
        time.insert(12,":");
        time.insert(10,":");
        time.insert(8," ");
        time.insert(6,"-");
        time.insert(4,"-");
        operationTime = time.toString();
        map.put("year",year);
        map.put("month",month);
        map.put("day",day);
        map.put("hour",hour);
        map.put("operationTime",operationTime);
        return map;
    }
}
